package net.sureon.biz;

import java.util.Date;
import java.util.List;

import net.sureon.common.exception.SureonException;
import net.sureon.dao.BalanceOperation;
import net.sureon.dao.Company;
import net.sureon.dao.ConsumeRecord;
import net.sureon.dao.DailyTimingStatistic;
import net.sureon.dao.RealTimeConsume;

public interface CompanyMgr {
	public CompanyBO getCompany(long companyID) throws SureonException;

	public List<CompanyBO> getAllCompanies() throws SureonException;

	public CompanyBO getCompany(String siteURL) throws SureonException;

	public long insertCompany(CompanyBO company) throws SureonException;

	public int updateCompany(CompanyBO company) throws SureonException;

	public CompanyConfigBO getCompanyConfig(long companyID)
			throws SureonException;

	public int mergeCompanyConfig(long companyID, String key, String value)
			throws SureonException;

	public List<DailyTimingStatistic> getDailyTimingStatisticByCompany(
			long companyID);

	public List<DailyTimingStatistic> getDailyTimingStatisticByCompany(
			long companyID, Date startDate, Date endDate);
	
	public float getCompanyBalance(long companyID);
	public Date getLastestConsume(long companyID);
	public List<BalanceOperation> getRecentTenBalanceOperation(long companyID);
	public List<ConsumeRecord> getRecentTenConsumeRecord(long companyID);
	public RealTimeConsume getCompanyConsumeStatus(long companyID, Date theMonth);
	public void insertConsumeRecord(ConsumeRecord record);
	public void insertBalanceOperation(BalanceOperation operation);	
	
	public List<CompanyBO> getCustomerByStatus(String companyStatus);
	
	public List<ConsumeRecord> getAllCompanyRecentTenConsumeRecord();
	public List<ConsumeRecord> getRecentTenConsumeRecordInRangeMonth(Date startMonth, Date endMonth) ;
	
	public List<ConsumeRecord> getConsumeRecordBySiteURLConsumeMonth(Date startMonth, Date endMonth, long companyID);
	
	public List<BalanceOperation> getAllCompanyBalanceOperation();
	
	public List<BalanceOperation> getBalanceOperationByOperationDate(Date startDate, Date endDate);
	
	public List<BalanceOperation> getBalanceOperationByCompanyIDAndOperationDate(long companyID, Date startDate, Date endDate) ;
}
